package com.hisicom.scqxspxcjc.common.file.repository;


import com.hisicom.scqxspxcjc.base.dao.BaseRepository;
import com.hisicom.scqxspxcjc.common.file.bean.FileBean;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.Date;
import java.util.List;

/**
 * @author zhonggls
 * @date 2020/4/21 17:18
 * @Explain
 */
public interface FileRepository extends BaseRepository<FileBean, String> {
    Page<FileBean> findAllByStatus(Pageable pageable, String status);
    List<FileBean> findByStatus(String status);
    List<FileBean> findByFkBusinessIdOrderByLabelAscSortAsc(String businessId);
    List<FileBean> findByFkBusinessIdAndLabelOrderBySortAsc(String businessId, String label);
    List<FileBean> findByFkBusinessIdAndLabelAndSort(String businessId, String label,String sort);
    List<FileBean> findByStatusAndCreateTimeBefore(String status, Date date);
    void deleteByFkBusinessId(String businessId);
    void deleteByFkBusinessIdAndLabel(String businessId,String label);
    void deleteByFkBusinessIdAndLabelAndSort(String businessId,String label,String sort);
    void deleteByStatusAndCreateTimeBefore(String status, Date date);
}
